/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2010, 2012 Oracle and/or its affiliates.  All rights reserved.
 *
 */

package tools;

import oracle.kv.KVStore;
import oracle.kv.KVStoreConfig;
import oracle.kv.KVStoreFactory;
import oracle.kv.Key;
import oracle.kv.Value;

/**
 * Classe responsable de l'initialisation des donnees dans la partie 1- A
 * @author Guerline Jean-Baptiste & Mouzaffar Akbaraly 
 */
public class DataInitializerA {

	private final KVStore store1;

	/**
	 * Runs the HelloBigDataWorld command line program.
	 */
	public static void main(String args[]) {
		try {
			new DataInitializerA();
			//example.runExample();
		} catch (RuntimeException e) {
			e.printStackTrace();
		}
	}

	/**
	 * Initialise le store
	 */
	DataInitializerA() {

		String storeName1 = "kvstore";
		String hostName1 = "ari-31-207-09";
		String hostPort1 = "5000";

		store1 = KVStoreFactory.getStore
				(new KVStoreConfig(storeName1, hostName1 + ":" + hostPort1));
		for(int i = 1; i <= 1000 ; i++){
			final String keyCategoryString = "C1";
			final String keyString = "P" + i;
			final String valueString = "1";
				store1.put(Key.createKey(keyCategoryString, keyString),
						Value.createValue(valueString.getBytes()));
		}
		store1.close();
	}

}
